// pages/historyBetPageDetail/historyBetPageDetail.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
      winData: [
        {num:'08,08,08,08,08,08,08',state:'一等奖',stateNum:1},
        { num: '08,08,08,08,08,08,08', state: '未中奖', stateNum:0 },
        { num: '08,08,08,08,08,08,08', state: '一等奖', stateNum: 1 },
        { num: '08,08,08,08,08,08,08', state: '未中奖', stateNum: 0 },
        { num: '08,08,08,08,08,08,08', state: '一等奖', stateNum: 1 },
        { num: '08,08,08,08,08,08,08', state: '未中奖', stateNum: 0 }
      ],
      winDataAlert: [
        {num:'08,08,08,08,08,08,08',state:'一等奖',stateNum:1,class:"win-red"},
        { num: '08,08,08,08,08,08,08', state: '二中奖', stateNum: 2, class:'win-orange' },
        { num: '08,08,08,08,08,08,08', state: '二等奖', stateNum: 2, class: 'win-orange' },
        { num: '08,08,08,08,08,08,08', state: '三等奖', stateNum: 3, class:"win-blue"},
        { num: '08,08,08,08,08,08,08', state: '三等奖', stateNum: 3, class: "win-blue" },
        { num: '08,08,08,08,08,08,08', state: '三等奖', stateNum: 3, class: "win-blue" }
        
      ],
      windDealData:[],
      windDealDataAlert:[],
    isShowAlert: false
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.windDealData()
    this.windDealDataAlert()
  },
  windDealData:function() {
    var win = this.data.winData
    var deal = []
    for (var k in win) {
      win[k].winArr = win[k].num.split(',')
    }
    console.log(win)
    this.setData({
      windDealData:win
    })
  },
  windDealDataAlert:function() {
    var win = this.data.winDataAlert
    var deal = []
    for (var k in win) {
      win[k].winArr = win[k].num.split(',')
    }
    console.log(win)
    this.setData({
      windDealDataAlert:win
    })
  },
  redeemBtn:function() {
    this.setData({
      isShowAlert:true
    })
  },
  close:function () {
    this.setData({
      isShowAlert:false
    })
  }
})